package com.team.six.bluecatshop.service;


import com.team.six.bluecatshop.domain.TestYingsheUser;
import com.team.six.bluecatshop.mapper.ProductMapper;
import com.team.six.bluecatshop.mapper.TestYingsheUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TestYingsheUserServiceImpl implements TestYingsheUserService {
    @Autowired
    private TestYingsheUserMapper testYingsheUserMapper;
    @Autowired
    private ProductMapper productMapper;

    @Override
    @Transactional
    public void add(TestYingsheUser testYingsheUser) {
        testYingsheUserMapper.insert(testYingsheUser);
    }

    @Override
    @Transactional
    public void remove(int id) {
        testYingsheUserMapper.deleteByPrimaryKey(id);
    }

    @Override
    public TestYingsheUser findById(int id) {
        TestYingsheUser testYingsheUser=testYingsheUserMapper.selectByPrimaryKey(id);
        return testYingsheUser;
    }

    @Override
    public List<TestYingsheUser> findAll() {
        List<TestYingsheUser> testYingsheUserList = testYingsheUserMapper.findAll();
        return testYingsheUserList;
    }

    @Override
    public TestYingsheUser findTestYingsheUserByCustomerId(String id) {
        TestYingsheUser testYingsheUser = testYingsheUserMapper.findByCustomerId(id);
        return testYingsheUser;
    }


    @Override
    @Transactional
    public void updateByPrimaryKey(TestYingsheUser testYingsheUser) {
        testYingsheUserMapper.updateByPrimaryKeySelective(testYingsheUser);
    }


}
